import { reqgetuserzhidi ,reqgetshopqingdan,} from '@/api'

const state = {
    Data: [],
    Shoplist:[]
}
const mutations = {
    GETUSERINFOS(state,rel){
        state.Data = rel
    },
    GETSHOPQINGDAN(state,rel){
        state.Shoplist = rel
    },
}
const actions = {
    // 获取用户地址信息
    async disgetuserInfo({ commit }) {
        let result = await reqgetuserzhidi()
        if(result.code == 200){
            commit('GETUSERINFOS', result.data)
        }
    },
    // 获取商品清单
    async getshopqingdan({commit}){
        let result = await reqgetshopqingdan()
        if(result.code == 200){
            commit('GETSHOPQINGDAN', result.data)
        }
    },
    // async reqsubmitOrder({commit},tradeNo){
    //     let result = await reqsubmitOrder(tradeNo)
        
    //     if(result.code == 200){
    //         commit('REQSUBMITORDER', result.data)
    //     }
    // }
}
const getters = {

}
export default {
    state,
    mutations,
    actions,
    getters
}